x86/viridian: add Partition Reference Time enlightenment
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 7 Jan 2015 10:28:57 +0000 (11:28 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 7 Jan 2015 10:28:57 +0000 (11:28 +0100)
commitdd94caca537212bfa7f976d0a0f286466709347f
tree2274c474f74abe010cd2677197c14738f5364f29
parentb4986813c59a41189886d1e8da05886455e8ad95
x86/viridian: add Partition Reference Time enlightenment

The presence of the partition reference time enlightenment persuades newer
versions of Windows to prefer the TSC as their primary time source. Hence,
if rdtsc is not being emulated and is invariant then many vmexits (for
alternative time sources such as the HPET or reference counter MSR) can
be avoided.

The implementation is not yet complete as no attempt is made to prevent
emulation of rdtsc if the enlightenment is active and guest and host
TSC frequencies differ. To do that requires invasive changes in the core
x86 time code and hence a lot more testing.

This patch avoids the issue by disabling the enlightenment if rdtsc is
being emulated, causing Windows to choose another time source. This is
safe, but may cause a big variation in performance of guests migrated
between hosts of differing TSC frequency. Thus the enlightenment is not
enabled in the default set, but may be enabled to improve guest performance
where such migrations are not a concern.

See section 15.4 of the Microsoft Hypervisor Top Level Functional
Specification v4.0a for details.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Christoph Egger <chegger@amazon.de>
docs/man/xl.cfg.pod.5
tools/libxl/libxl_dom.c
tools/libxl/libxl_types.idl
xen/arch/x86/hvm/viridian.c
xen/include/asm-x86/hvm/viridian.h
xen/include/public/arch-x86/hvm/save.h
xen/include/public/hvm/params.h